﻿using System;
using Kiiro.SiteDefinition.Core;
using Kiiro.Common.Entities;
using Kiiro.Common.Utility;

namespace Kiiro.SiteDefinition.ControlTemplates
{
    public partial class PersonStatus : KiiroUserControl
    {
        public User User { get; set; }

        protected void Page_Load ( object sender, EventArgs e )
        {
            if ( Base.CurrentUser != null && Base.CurrentUser.Groups.Contains ( KiiroGroup.PortalMember ) )
            {
                User = Base.CurrentUser;
            }
        }

        protected override void OnPreRender ( EventArgs e )
        {
            base.OnPreRender ( e );

            Visible = User != null;

            if ( User != null )
            {   
                hidUserId.Value = User.Id.ToString ( );
                txtPersonStatus.Text = User.StatusNote ?? "";
            }
        }
    }
}

/*************************************************************************
 * 
 * $Log: /Internal Projects/Kiiro/Kiiro.SiteDefinition/12/TEMPLATE/CONTROLTEMPLATES/Kiiro/PersonStatus.ascx.cs $
 * 
 * 8     1/25/10 1:17p Camerons
 * 
 * 7     12/17/09 5:28p Camerons
 * 
 * 6     17/08/09 11:07a Camerons
 * Added check-in comments section
 * 
 ************************************************************************/